﻿﻿using System;
using System.Collections.Generic;
using System.Web;
namespace BlackHtml5.WebSite.Web.Default.Common.Public
{
    public class SuccessAction  : Controller
	{
		public SuccessAction(System.IO.TextWriter tw):base(tw){}
		public SuccessAction(string fileName) : base(fileName) {}
		public SuccessAction(HttpContext context):base(context){}
		public SuccessAction(Microsoft.Owin.IOwinContext context):base(context){}
        public new void Success(string message,string url,int second)
        {
            
			Write("﻿");
			Write("\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>跳转提示</title>\r\n<style type=\"text/css\">\r\n*{ padding: 0; margin: 0; }\r\nbody{ background: #fff; font-family: \'微软雅黑\'; color: #333; font-size: 16px; }\r\n.system-message{ padding: 24px 48px; }\r\n.system-message h1{ font-size: 100px; font-weight: normal; line-height: 120px; margin-bottom: 12px; }\r\n.system-message .jump{ padding-top: 10px}\r\n.system-message .jump a{ color: #333;}\r\n.system-message .success,.system-message .error{ line-height: 1.8em; font-size: 36px }\r\n.system-message .detail{ font-size: 12px; line-height: 20px; margin-top: 12px; display:none}\r\n</style>\r\n</head>\r\n<body>\r\n<div class=\"system-message\">\r\n");
			if(!string.IsNullOrEmpty(message)){
				Write("\r\n    <h1>:)</h1>\r\n    <p class=\"success\">");
				Write(message);
				Write("</p>\r\n");
			}
			Write("\r\n<p class=\"detail\"></p>\r\n<p class=\"jump\">\r\n页面自动 <a id=\"href\" href=\"");
			Write(url);
			Write("\">跳转</a> 等待时间<b id=\"wait\">");
			Write(second);
			Write("</b>\r\n</p>\r\n</div>\r\n<script type=\"text/javascript\">\r\n    (function () {\r\n        var wait = document.getElementById(\'wait\'), href = document.getElementById(\'href\').href;\r\n        var interval = setInterval(function () {\r\n            var time = --wait.innerHTML;\r\n            if (time <= 0) {\r\n                location.href = href;\r\n                clearInterval(interval);\r\n            };\r\n        }, 1000);\r\n    })();\r\n</script>\r\n</body>\r\n</html>");
        }
        
        
        
        
		
        
    }
}